﻿using System;
using RootMotion.FinalIK;
using UnityEngine;

namespace RootMotion.Demos
{
	// Token: 0x020000A5 RID: 165
	public class HitReactionTrigger : MonoBehaviour
	{
		// Token: 0x06000575 RID: 1397 RVA: 0x00035590 File Offset: 0x00033790
		public void Update()
		{
			if (Input.GetMouseButtonDown(0))
			{
				Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
				RaycastHit raycastHit = default(RaycastHit);
				if (Physics.Raycast(ray, out raycastHit, 100f))
				{
					this.hitReaction.Hit(raycastHit.collider, ray.direction * this.hitForce, raycastHit.point);
					this.colliderName = raycastHit.collider.name;
				}
			}
		}

		// Token: 0x06000576 RID: 1398 RVA: 0x00035610 File Offset: 0x00033810
		public void OnGUI()
		{
			GUILayout.Label("LMB to shoot the Dummy, RMB to rotate the camera.", new GUILayoutOption[0]);
			if (this.colliderName != string.Empty)
			{
				GUILayout.Label("Last Bone Hit: " + this.colliderName, new GUILayoutOption[0]);
			}
		}

		// Token: 0x04000461 RID: 1121
		[SerializeField]
		public HitReaction hitReaction;

		// Token: 0x04000462 RID: 1122
		[SerializeField]
		public float hitForce = 1f;

		// Token: 0x04000463 RID: 1123
		public string colliderName;
	}
}
